<template>
  <div id="app">
    <div
      v-loading.fullscreen.lock="$store.state.app.loading"
      element-loading-spinner="el-icon-loading"
      class="loading"
    />
    <router-view v-if="isRouterAlive" :key="$route.fullPath" />
    <!---->
    <myModalVideo :obj="objFour" @close="close">
      <div class="mpdalBody">
        <video
          v-if="url != ''"
          ref="myvideo"
          class="myvideo"
          autoplay
          controls
          loop
        >
          <source :src="url">
        </video>
      </div>
    </myModalVideo>
    <!---->
  </div>
</template>

<script>
import myModalVideo from '@/components/ModalVideo'
export default {
  name: 'App',
  components: { myModalVideo },
  provide() {
    return {
      reload: this.reload
    }
  },
  beforeRouteEnter(to, from, next) {
    console.log('1111222222')
    next()
  },
  data() {
    return {
      isRouterAlive: true,
      objFour: {
        title: '',
        show: false,
        width: ''
      },
      url: ''
    }
  },
  methods: {
    reload() {
      this.isRouterAlive = false
      this.$nextTick(() => {
        this.isRouterAlive = true
      })
    },
    showDialog(params) {
      this.url = params.url
      this.objFour.show = true
    },
    close() {
      this.$refs.myvideo.pause()
      this.url = ''
    }
  }
}
</script>
<style scoped>
/*max-height: 500px;min-width: 500px;*/
.myvideo {
  width: 100%;
  object-fit: cover;
  height: auto;
}
.mpdalBody {
  padding: 10px;
}
</style>
<style >
.el-icon-loading {
  font-size: 30px;
}
.el-icon-my-1{background:url(assets/gaikuang.png);background-size:100% 100%;background-position: center;}
.el-icon-my-2{background:url(assets/fangchanguanli.png);background-size:100% 100%;background-position: center;}
.el-icon-my-3{background:url(assets/chuzuguanli.png);background-size:100% 100%;background-position: center;}
.el-icon-my-4{background:url(assets/yewurenyuan.png);background-size:100% 100%;background-position: center;}
.el-icon-my-5{background:url(assets/yewuyunying.png);background-size:100% 100%;background-position: center;}
.el-icon-my-6{background:url(assets/zhanghaoguanli.png);background-size:100% 100%;background-position: center;}
.el-icon-my-7{background:url(assets/xitongguanli.png);background-size:100% 100%;background-position: center;}
</style>
